<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../head/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="window.role.manager"/></title>
<script type="text/javascript"> 
//查找角色
var roleList_= '<z:ukey key="roleList"  context="admin"/>';
//编辑角色
var editRole_= '<z:ukey key="editRole"  context="admin"/>';

//根据角色id查找角色
var findRoleById_= '<z:ukey key="findRoleById"  context="admin"/>';
//删除角色
var deleteRole_= '<z:ukey key="deleteRole"  context="admin"/>';
//校验角色名称	
var existrole_= '<z:ukey key="existRole"  context="admin"/>';
//查到角色对应的帐户
var findaccount_= '<z:ukey key="findAccount"  context="admin"/>';
//查到角色对应的帐户
var assignaccount_= '<z:ukey key="assignAccount"  context="admin"/>';

//应用系统
var craapphelper_= '<z:ukey key="craAppHelper"  context="admin"/>';
var initAccountInfo = '<z:ukey key="initAccountInfo"  context="admin"/>';

//是否要修改数据
var message_info_modify_select_delete = '<spring:message code="message.info.modify.select" arguments="'+lable_delete+'"/>';
</script>
<script type="text/javascript" src="<%=localServer%>/page/app/role.js" charset="UTF-8"></script>
</head>
<body>
	<!-- 功能模块选中的帐户信息 -->
	<input type="hidden" value="" id="fn_select_account_ids" />
	<input type="hidden" value="" id="fn_select_account_names" />
	
	<table id="roleList" toolbar="#role_list_button">
		<thead>
			<tr>
				<th field="ck" checkbox="true"></th>
				<th field="id" width="80" align="center"><spring:message code="lable.id"/></th>
				<th field="roleNm" width="80" align="center"><spring:message code="lable.role.rolenm"/></th>
				<th field="appNm" width="80" align="center"><spring:message code="lable.role.application"/></th>
			</tr>
		</thead>
	</table>
	<div id="role_list_button" style="height: auto">
		<spring:message code="lable.application"/><select id="cra_app" name="cra_app" style="width: 160px"
			onchange="craAppChange()">
		</select>
	</div>
	<!-- 帐户选择 -->
	<div id="select_account" style="display: none; width: 640px; height: 450px;top:0px;left:0px;"
		title="给角色指派账户">
		<iframe width="100%"  style="top:0px;left:0px"  height="100%" id="account_search" name="frame" frameborder="0" scrolling="no"></iframe>
	</div>
	
	<!-- 编辑角色-->
	<div id="edit_role"
		style="display: none; width: 300px; height: 220px; top: 0px; left: 0px;" title='<spring:message code="window.role.edit"/>'>
		<form id="edit_role_form" method="post">
			<table width="280px" border="0">
				<tr>
					<td><div align="right"><spring:message code="lable.role.rolenm"/></div></td>
					<td><div align="left">
							<input type="hidden" name="id" id="id"> <input
								type="text" class="easyui-validatebox" value=""
								name="roleNm" required="true" id="roleNm" 
								validType="length[1,8]&remote[existrole_+'?roleId='+$('#id').val(),'roleNm','appCd='+$('#appCd').val(),'jsoncallback=?']" invalidMessage="{remote:'角色名称己经存在请重新输入'}" event="change"/>
						</div></td>
				</tr>
				<tr>

					<td><div align="right"><spring:message code="lable.role.application"/></div></td>
					<td><div align="left">
							<select id="appCd" name="appCd" style="width: 160px">
						</div></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>